extends ColorRect
@onready var attackPropertyLabel = $AttackProperty
@onready var defencePropertyLabel = $DefenceProperty
@onready var entityAttributeLabel = $EntityAttribute


func init():
	if not Inventory.currentSelectedEntityData: 
		attackPropertyLabel.text = ""
		defencePropertyLabel.text = ""
		return
	
	var props = Inventory.currentSelectedEntityData.getProperties()
	var attributesDict = Inventory.currentSelectedEntityData.getAttributes()
	
	var attackTemplate = ConfigClasses.OtherInfoTemplateConfig.configsDict[Consts.PROP_TEMPLATE_ATTACK].template
	var attackText = Global.replacePlaceholders(attackTemplate, props)
	
	var defenceTemplate = ConfigClasses.OtherInfoTemplateConfig.configsDict[Consts.PROP_TEMPLATE_DEFENCE].template
	var defenceText = Global.replacePlaceholders(defenceTemplate, props)
	
	var attributeTemplate = ConfigClasses.OtherInfoTemplateConfig.configsDict[Consts.ATTR_TEMPLATE].template
	var attributeText = Global.replacePlaceholders(attributeTemplate, attributesDict)
	
	attackPropertyLabel.text = attackText
	defencePropertyLabel.text = defenceText
	entityAttributeLabel.text = attributeText
	
	
